# coding=utf-8
import os
import uuid

AStockBasicInfoDB           = "AStockBasicInfo.db"
AStockTHSCatagoriesDB       = "AStockTHSCatagories.db"
AStockBasicInfoTable        = "stock_basic"
AStockTHSCategoriesTable    = "stock_categories"
Category2AStockTable        = "category2stock"

TGBFuPanArticalIndexDB      = "TGBFuPanArticalIndexDB.db"
TGBFuPanArticalIndexTable   = "articals"

WXArticleIndexDB            = "WXArticleIndexDB.db"
WXArticleIndexTable         = "articles"

BasicInfoDB         = 'BasicInfo.db'
BasicInfoTable      = 'BasicInfo'
StockDailyTable     = 'StockDaily_'

PRICE_COLS = ['open', 'close', 'high', 'low', 'open_adj', 'close_adj', 'high_adj', 'low_adj','pre_close']
FORMAT = lambda x: '%.2f' % x


def get_database_path():
    warehouse_path = os.getcwd()
    warehouse_path = warehouse_path + '/ExternalFiles/'
    os.makedirs(warehouse_path, exist_ok=True)
    return warehouse_path

def get_article_content_path(writer_name):
    warehouse_path = get_database_path()
    warehouse_path = warehouse_path + 'ArticalContents/' + str(writer_name)
    os.makedirs(warehouse_path, exist_ok=True)
    return warehouse_path

def get_article_content_root_path():
    warehouse_path = get_database_path()
    warehouse_path = warehouse_path + 'ArticalContents/'
    os.makedirs(warehouse_path, exist_ok=True)
    return warehouse_path

def get_random_id():
    return str(uuid.uuid4()).replace('-', '')


#
# if __name__ == "__main__":
#
#     get_last_trade_date(format='%Y%m%d')
#     exit(0)